<?php $this->load->view('layout/header'); ?>
<form name="form1" method="post" action="<?php echo b_url('extension/chat_action').'/'.$info['chatid'];?>" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">

    <div>
    </div>
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    <span id="lblTitle">添加</span>
                    账号
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>语言版本：
                </td>
                <td>
                    <select name="configid" id="configid">
                        <option value="-1">请选择</option>
                        <?php foreach($config as $k=>$v) : ?>
                            <option value="<?php echo $v['configid']?>" <?php if($v['configid'] == $info['configid']){echo 'selected="selected"';}?>><?php echo $v['languagever']?></option>
                        <?php endforeach ;?>
                    </select>
                    <span id="configid_tips" style="color:Red;display:none;">请选择</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>账号类型：
                </td>
                <td>
                    <span id="radTypeID">
                        <?php foreach($chat_type as $key=>$val): ?>
                            <input id="radTypeID_<?php echo $key?>" name="typeid" type="radio" value="<?php echo $key?>" <?php if($info['typeid'] && $key==$info['typeid']){echo 'checked';}elseif($key==1){echo 'checked';}?>><?php echo $val?>
                        <?php endforeach; ?>
                    </span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>昵称：
                </td>
                <td>
                    <input name="nickname" type="text" id="nickname" value="<?php echo $info['nickname']?>" />
                    <span id="nickname_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>账号：
                </td>
                <td>
                    <input name="account" type="text" id="account" value="<?php echo $info['account']?>" />
                    <span id="account_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    Key值：
                </td>
                <td>
                    <input type="text" name="chatkey" id="chatkey" value="<?php echo $info['chatkey']?>">
                    <span id="chatkey_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>排序号：
                </td>
                <td>
                    <input name="listid" num="true" type="text"  id="txtListID" value="<?php echo $info['listid']?$info['listid']:0;?>" />
                    <span id="listid_tips" style="color:Red;display:none;">不能为空</span>
                    <span id="listid_num_tips" style="color:Red;display:none;">只能为数字</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    是否关闭：
                </td>
                <td>
                    <span id="radIsClose">
                        <input id="radIsClose_0" type="radio" name="isclose" value="1" <?php if($info['isclose'] == 1){echo 'checked="checked"';}?> /><label for="radIsClose_0">是</label>
                        <input id="radIsClose_1" type="radio" name="isclose" value="0" <?php if($info['isclose'] == 0 || empty($info)){echo 'checked="checked"';}?> /><label for="radIsClose_1">否</label>
                    </span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">
                    &nbsp;
                </td>
                <td colspan="3">
                    <input type="submit"  value="保存" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSave" />
                    <input type="button"  value="返回" onclick="javascript:history.go(-1);" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
    </div>

    <script type="text/javascript">
        $('#form1').submit(function() {
            var is = true;
            if (!input_tips($('#nickname'))) {
                is = false;
            }
            if (!selete_tips($('#account'))) {
                is = false;
            }
            if (!input_tips($('#listid'))) {
                is = false;
            }
            return is;
        })
    </script>
</form>
<?php $this->load->view('layout/footer'); ?>
